﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<Dictionary<MensUnoShop.Models.UTag,MensUnoShop.Models.UTagUrlAlias>>" %>
<%@ Import Namespace="MensUnoShop.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ChildList
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="main-content" class="hastable">
		    <%Dictionary<UTag, UTagUrlAlias> parent = ViewData["ParentTag"] as Dictionary<UTag, UTagUrlAlias>; %>
            <div class="title title-spacing">
			    <h2>分類管理</h2>
               [ <b><%:parent.First().Key.TAGtitle %></b> ] 次分類清單
		    </div>
            <form action="" method="post">
            
            <input type="hidden" name="Act" value="<%:ViewData["action"] %>" />
            <input type="hidden" name="tagid" value="<%:TempData["tagid"] %>" />
            <input type="hidden" name="parentid" value="<%:parent.First().Key.TAGid %>" />
            <table cellspacing="0" style="width:850px;">
                <tr>
					<th style="width:50px">次分類</th>
					<td style="width:150px;text-align:left">
                        <input type="text" name="title" value="<%:TempData["title"] %>" />
                    </td>
					<th style="width:50px">SEO別名</th>
					<td style="width:150px;text-align:left">
                        <input type="text" name="alias" value="<%:TempData["alias"] %>"/>
                    </td>
                </tr>
                <tr>
					<th style="width:50px">連結說明</th>
					<td style="width:150px;text-align:left">
                        <input type="text" name="tagalt" value="<%:TempData["tagalt"] %>"/>
                    </td>
                    
				
                    <th style="width:50px">指定連結(Option)</th>
					<td style="width:300px;text-align:left">
                        <input type="text" name="url" size="70" value="<%:TempData["url"] %>"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="4"><input type="submit" value="<%:ViewData["bmsg"] %>"/></td>
                </tr>
            </table>
            </form>
            <table cellspacing="0" style="width:850px;">
            <thead>
				<tr>
					<td style="width:30px">序號</td>
					<td style="width:70px">標籤編號</td>
                    <td style="width:200px;text-align:left">標籤</td>
                    <td style="width:150px;text-align:left">SEO別名</td>
                    <td style="width:150px;text-align:left">連結說明</td>
                    <td style="width:50px">狀態</td>
                    <td style="width:200px">操作</td>
				</tr>
			</thead>
            <%if (Model != null){%>
             <tbody>
            <%
                List<MensUnoShop.Models.UTag> ulist = Model.Keys.ToList();
                for (int i = 0; i < ulist.Count;i++ )
              {  
                  
                  %>
                <tr>
					<td class="center" ><%:(i+1) %></td>
					<td class="center"><%:ulist[i].TAGid %></td>
                    <td><%:ulist[i].TAGtitle%></td>
                    <td><%:Model[ulist[i]].TUAalias%></td>
                    <td><%:ulist[i].TAGalt%></td>
                    <td class="center" style="padding:0"><%:ulist[i].TAGstatus == true ? "顯示" : "隱藏"%></td>
                    <td class="center" >
                        <form action="" method="post" style="display:inline">
                            <input type="hidden" name="tagid" value="<%:ulist[i].TAGid %>" />
                            <input type="hidden" name="Act" value="ChgStatus" />
                            <%if (ulist[i].TAGstatus)
                              { %><input type="submit" name="cstatus" value="隱藏" /><%}else{ %><input type="submit" name="cstatus" value="開啟" /><%} %>
                        </form>
                        <form action="" method="post" onsubmit="return confirm('確定刪除?');"  style="display:inline">
                            <input type="hidden" name="tagid" value="<%:ulist[i].TAGid %>" />
                            <input type="hidden" name="Act" value="Del" />
                            <input type="submit" name="cstatus" value="刪除" />
                        </form>
                        <form action="" method="post" style="display:inline">
                            <input type="hidden" name="tagid" value="<%:ulist[i].TAGid %>" />
                            <input type="hidden" name="Act" value="Upt" />
                            <input type="submit" name="cstatus" value="修改" />
                        </form>
                    </td>
				</tr>
            <%} %>
            </tbody>
            <%} %>
            </table>
            <input type="button" name="cstatus" value="回主分類管理" onclick="location.href='/Admin/TagSetup/mainlist'"/>
            <br/><br/>　
        </div>

</asp:Content>
